unit ImprimeRespostaCartao;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, StdCtrls, Mask, ExtCtrls;

type
  TFormImprimirRespostaCartao = class(TForm)
    Label3: TLabel;
    ComboBox1: TComboBox;
    Label5: TLabel;
    MaskEdit1: TMaskEdit;
    BitBtn1: TBitBtn;
    OpenDialog1: TOpenDialog;
    Panel1: TPanel;
    Label1: TLabel;
    Edit1: TEdit;
    SpeedButton1: TSpeedButton;
    Memo1: TMemo;
    procedure SpeedButton1Click(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormImprimirRespostaCartao: TFormImprimirRespostaCartao;

implementation

uses principal, funcoesapoio;

{$R *.dfm}

procedure TFormImprimirRespostaCartao.SpeedButton1Click(Sender: TObject);
begin
        OpenDialog1.Execute;
        Edit1.Text:=OpenDialog1.FileName;
        Memo1.Lines.LoadFromFile(Edit1.Text);
        Refresh;
end;

procedure TFormImprimirRespostaCartao.BitBtn1Click(Sender: TObject);
var valor:String;
begin
        valor:=Maskedit1.Text; virgula:=pos(',',valor);
        Delete(valor, virgula, 1);
        FormPrincipal.ValorTEF:=valor;
        FormPrincipal.PagtoTEF:=ComboBox1.Text;
        FormPrincipal.TextoPagamento:=Edit1.Text;

end;

procedure TFormImprimirRespostaCartao.FormShow(Sender: TObject);
var i:integer;
begin
        CapturaDadosProgamadosECF(2); // Captura Meios de Pagamento
        for i:=1 to 20 do begin
                if not (MeiosPagamento[i].Legenda='') then begin
                        Combobox1.Items.ADD(MeiosPagamento[i].Legenda);
                end;
        end;
        try
                ComboBox1.Text:=MeiosPagamento[1].Legenda;
        except;
        end;
        if FormImprimirRespostaCartao.Height=400 then begin
            label5.Visible:=False;  MaskEdit1.Visible:=False;
            panel1.top:=48;
        end
        else begin
            label5.Visible:=True;  MaskEdit1.Visible:=True;
            panel1.top:=83;
        end;
end;

end.
